@extends('layouts.supervisor')

@section('content')

<style type="text/css">
.delegate{margin:10px;}
</style>
<div class="page-content">
    <div class="page-header">
        <h1>审核学生选题</h1>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <div class="row form-horizontal">
                <label class="col-xs-12 col-sm-2 control-label no-padding-right alert alert-block alert-success"> 当前论文选题 </label>
                <div class="form-actions col-xs-12 col-sm-6" style="margin-top:0px; margin-left:5px;background:#f5f5f5">
                    <label>
                    {{$current? $current->title : ''}}</label>
                </div>           
            </div>
            <div class="hr hr16 hr-double"></div>
            <div class="row form-horizontal">
                <label class="col-xs-12 col-sm-2 control-label no-padding-right alert alert-block alert-success"> 历史版本</label>
                 <div class="col-xs-12 col-sm-6" style="margin-top:0px; margin-left:5px;background:#f5f5f5">
                    <div id="profile-feed-1" class="profile-feed" style="overflow: hidden; height: 100px;">
                        @foreach($history as $item)
                        <div class="profile-activity clearfix">
                            <div>
                                
                                <a class="user" href="#">{{$item->title}}</a>
                                <div class="time">
                                    <i class="icon-time bigger-110" style="margin-right:5px;"></i>提交时间:{{$item->created_at}}
                                </div>
                            </div>
                        </div>
                        @endforeach
                    </div>
                </div>
            </div>
            <div class="hr hr16 hr-double"></div>
            <div class="row form-horizontal">
                <label class="col-xs-12 col-sm-2 control-label no-padding-right alert alert-block alert-success"> 和学生讨论 </label>
                 <div class="col-xs-12 col-sm-6" style="margin-top:0px; margin-left:5px;background:#f5f5f5">
                    @include('comment', $commentInfo)
                </div>      
            </div>
            <div class="hr hr16 hr-double"></div>
            <div class="row form-horizontal">
               <label class="alert alert-block alert-success col-xs-12 col-sm-2 control-label no-padding-right"> 导师最终意见 </label>
                 <div class="form-actions col-xs-12 col-sm-6" style="margin-top:0px; margin-left:5px;background:#f5f5f5">
                    @if($thesis->approved)
                    <span class="label label-success arrowed-in arrowed-in-right" style="font-size:16px; height:24px;">审核通过</span>
                    @else
                    <form id="title-form" name="title-form" class="form-horizontal" method="POST" action="/supervisor/thesis/storetitle" >
                        {{ csrf_field() }}
                        <input type="hidden" class="col-xs-10 col-sm-5" id='student' name="student" value="{{$student->id}}" />
                         <button class="btn btn-info btn-sm" type="button" onclick="event.preventDefault(); document.getElementById('title-form').submit();">
                            <i class="icon-ok bigger-110"></i>
                            确认选题合理
                        </button>
                    </form>
                    @endif
                </div>
            </div>
        </div>
    </div>

</div>

<script type="text/javascript">
    @if($history->count() > 0)
    $('#profile-feed-1').slimScroll({
        height: '150px',
        alwaysVisible : false
    });
    @endif
</script>
@endsection



